﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Model
{
    public partial class T_PayRecordsObject
    {

        private System.Int32 db_OID;
        private System.DateTime db_PayDate;
        private System.String db_PayItem;
        private System.Int32 db_PayObject;
        private System.Int32 db_PayCategoryOID;
        private System.Int32 db_PayNecessity;
        private System.Decimal db_PaySum;
        private System.String db_PayMemo;

        public System.Int32 Db_OID
        {
            get { return db_OID; }
            set { db_OID = value; }
        }
        public System.DateTime Db_PayDate
        {
            get { return db_PayDate; }
            set { db_PayDate = value; }
        }
        public System.String Db_PayItem
        {
            get { return db_PayItem; }
            set { db_PayItem = value; }
        }
        public System.Int32 Db_PayObject
        {
            get { return db_PayObject; }
            set { db_PayObject = value; }
        }
        public System.Int32 Db_PayCategoryOID
        {
            get { return db_PayCategoryOID; }
            set { db_PayCategoryOID = value; }
        }
        public System.Int32 Db_PayNecessity
        {
            get { return db_PayNecessity; }
            set { db_PayNecessity = value; }
        }
        public System.Decimal Db_PaySum
        {
            get { return db_PaySum; }
            set { db_PaySum = value; }
        }
        public System.String Db_PayMemo
        {
            get { return db_PayMemo; }
            set { db_PayMemo = value; }
        }

        public void Data2Object(DataRow value)
        {
            if (value["OID"] != DBNull.Value)
                db_OID = System.Int32.Parse(value["OID"].ToString());
            if (value["PayDate"] != DBNull.Value)
                db_PayDate = System.DateTime.Parse(value["PayDate"].ToString());
            db_PayItem = value["PayItem"].ToString();
            if (value["PayObject"] != DBNull.Value)
                db_PayObject = System.Int32.Parse(value["PayObject"].ToString());
            if (value["PayCategoryOID"] != DBNull.Value)
                db_PayCategoryOID = System.Int32.Parse(value["PayCategoryOID"].ToString());
            if (value["PayNecessity"] != DBNull.Value)
                db_PayNecessity = System.Int32.Parse(value["PayNecessity"].ToString());
            if (value["PaySum"] != DBNull.Value)
                db_PaySum = System.Decimal.Parse(value["PaySum"].ToString());
            db_PayMemo = value["PayMemo"].ToString();
        }

        public DataRow Object2Data(ref DataRow value)
        {
            value["OID"] = db_OID;
            value["PayDate"] = db_PayDate;
            value["PayItem"] = db_PayItem;
            value["PayObject"] = db_PayObject;
            value["PayCategoryOID"] = db_PayCategoryOID;
            value["PayNecessity"] = db_PayNecessity;
            value["PaySum"] = db_PaySum;
            value["PayMemo"] = db_PayMemo;
            return value;
        }
    } // end of class
}
